<template>
   <div>
     <zm-detail-table
     class="mt10"
      :list="detailList"
      :info="infoData"
     />
   </div>
</template>

<script>
import tableMixin from '@/mixins/zmTableMixin'
import ZmDetailTable from '@/components/zmDetailTable'
import {detailList, saleCoupon, pointCard, secondCard} from './const'
export default {
  name: 'BaseMsg',
  components: {ZmDetailTable},
  mixins: [tableMixin],
  inject: ['$detail'],
  data () {
    return {

    }
  },
  computed: {
    // 注入infoData
    infoData () {
      return this.$detail.infoData
    },
    detailList () {
      switch (this.infoData.type) {
        // 优惠券
        case '5':
          return saleCoupon(this)
        case '3':
          return pointCard(this)
        case '4':
          return secondCard(this)
        default:
          return detailList(this)
      }
    }
  },
  watch: {},
  created () {
    console.log(this.infoData, 'Detail')
  },
  methods: {
  }
}
</script>

<style scoped lang='scss'>

</style>
